<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
    <#assign base=request.contextPath  />
    <base id="base" href="${base}">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${base}/static/win10/component/layui/css/layui.css" media="all">
   <script>
        var base =  "${base}";
    </script>
</head>
<body>
<br>
<form class="layui-form " action="">
          <div class="layui-form-item">
              <label class="layui-form-label">门店电话</label>
              <div class="layui-input-block">
                  <input type="text" id="shopTel" name="shopTel"   autocomplete="off" placeholder="请输入门店电话"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">门店地址</label>
              <div class="layui-input-block">
                  <input type="text" id="shopAddress" name="shopAddress"   autocomplete="off" placeholder="请输入门店地址"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">店主</label>
              <div class="layui-input-block">
                  <input type="text" id="shopKeeper" name="shopKeeper"   autocomplete="off" placeholder="请输入店主"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">审核状态 1 通过 2 未通过 3待审核</label>
              <div class="layui-input-block">
                  <input type="text" id="examineStatus" name="examineStatus"   autocomplete="off" placeholder="请输入审核状态 1 通过 2 未通过 3待审核"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">身份 1 个人 2 个体商户 3 企业</label>
              <div class="layui-input-block">
                  <input type="text" id="identity" name="identity"   autocomplete="off" placeholder="请输入身份 1 个人 2 个体商户 3 企业"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">身份证反面</label>
              <div class="layui-input-block">
                  <input type="text" id="idCardBack" name="idCardBack"   autocomplete="off" placeholder="请输入身份证反面"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">身份证正面</label>
              <div class="layui-input-block">
                  <input type="text" id="idCardJust" name="idCardJust"   autocomplete="off" placeholder="请输入身份证正面"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">营业执照</label>
              <div class="layui-input-block">
                  <input type="text" id="businessLicense" name="businessLicense"   autocomplete="off" placeholder="请输入营业执照"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">店铺类型</label>
              <div class="layui-input-block">
                  <input type="text" id="shopType" name="shopType"   autocomplete="off" placeholder="请输入店铺类型"
                         class="layui-input">
              </div>
          </div>

    <div align="center">
        <button type="button" class="layui-btn" id="submit">保存</button>
    </div>
</form>

<script src="${base}/static/win10/component/layui/layui.js?t=1"></script>
<script src="${base}/static/win10/js/jquery-1.8.3.min.js?t=1"></script>
<script>
    layui.use(['form', 'layer'], function() {
        var form = layui.form
                , layer = layui.layer;
        $("#submit").on("click",function () {
            if(check()===false){
                return;
            }

            var formDate = {
                         shopTel:$("#shopTel").val(),
                         shopAddress:$("#shopAddress").val(),
                         shopKeeper:$("#shopKeeper").val(),
                         examineStatus:$("#examineStatus").val(),
                         identity:$("#identity").val(),
                         idCardBack:$("#idCardBack").val(),
                         idCardJust:$("#idCardJust").val(),
                         businessLicense:$("#businessLicense").val(),
                           shopType:$("#shopType").val()
            }
            $.ajax({
                type: "POST",
                url: base+"/shopExamine/addShopExamine",
                data: formDate,
                success: function (data) {
                    layer.msg(data.msg)
                    if (data.code === 200) {
                        window.location.href=base+"/shopExamine/main.html"
                    } else {

                    }
                }
            });
        })







        function check(){
                   if($("#shopTel").val().length<1){
                       layer.msg("请输入门店电话");
                       return false;
                   }
                   if($("#shopAddress").val().length<1){
                       layer.msg("请输入门店地址");
                       return false;
                   }
                   if($("#shopKeeper").val().length<1){
                       layer.msg("请输入店主");
                       return false;
                   }
                   if($("#examineStatus").val().length<1){
                       layer.msg("请输入审核状态 1 通过 2 未通过 3待审核");
                       return false;
                   }
                   if($("#identity").val().length<1){
                       layer.msg("请输入身份 1 个人 2 个体商户 3 企业");
                       return false;
                   }
                   if($("#idCardBack").val().length<1){
                       layer.msg("请输入身份证反面");
                       return false;
                   }
                   if($("#idCardJust").val().length<1){
                       layer.msg("请输入身份证正面");
                       return false;
                   }
                   if($("#businessLicense").val().length<1){
                       layer.msg("请输入营业执照");
                       return false;
                   }
                   if($("#shopType").val().length<1){
                       layer.msg("请输入店铺类型");
                       return false;
                   }
        }
    });

</script>
</body>
</html>